{% extends 'base.html' %}
{% block left %}
    {% include "menu.html" %}
{% endblock %}
{% load zui %}
{% load my_template %}
{% block nav_bar %}
    <li>房源管理</li>
    <li>发布租房</li>
{% endblock %}
{% block workarea %}
    {{ form.media }}
    <div class="col-xs-12 col-sm-12 col-lg-9 reg-right col-lg-push-1">
        <form action="" method="post" class="form form-horizontal" enctype="multipart/form-data">
            {% csrf_token %}
            <div class="form-horizontal">
                <legend align="center">发布租房</legend>
                <div class="form-group ">
                    <label class="col-md-3 control-label">选择所属上级城市</label>
                    {% if object.city_id %}
                        {% city_tag 'A' object.city.id %}
                    {% else %}
                        {% city_tag 'S' object.city.id %}
                    {% endif %}
                </div>
                {% zui_field form.name layout='horizontal' %}
                {% zui_field form.address layout='horizontal' %}
                {% zui_field form.rent_money layout='horizontal' %}
                {% zui_field form.size layout='horizontal' %}
                {% zui_field form.position layout='horizontal' %}
                {% zui_field form.decorate layout='horizontal' %}
                {% zui_field form.rent_way layout='horizontal' %}
                {% zui_field form.type layout='horizontal' %}
                {% zui_field form.layout layout='horizontal' %}
                {% zui_field form.floor_num layout='horizontal' %}
                {% zui_field form.floor_total layout='horizontal' %}
                {% zui_field form.info layout='horizontal' %}
{#                {% zui_form form layout='horizontal' %}#}
                <div class="col-md-6 col-md-push-3">
                    {% zui_formset formset layout='horizontal' %}
                </div>
                <div class="col-md-8 col-md-push-4">
                    <table class="table">
                        <tbody>
                        {% for item in item_list %}
                            <tr>
                                <td>
                                    {{ item.house_pic }}
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
                <div class="form-group">
                    <div class="hidden-xs hidden-sm col-md-3 col-lg-3"></div>
                    <div class="col-xs-12 col-sm-12 col-md-10 col-lg-9 col-lg-push-3">
                        <input type='submit' id='submit' class='btn btn-primary' value='发布'
                               data-loading='稍候...'/>
                    </div>
                </div>
            </div>
        </form>
    </div>

{% endblock %}
{% block js %}
    <script src="{{ STATIC_URL }}javascript/apps/city_tag.js"></script>
{% endblock %}


